import request from '@/utils/request';

//员工申请加入部门
export function applyJoinDep(id) {
    return request({
        url: `/section/${id}/join`,
        method: 'get',
    })
}

// 员工修改个人信息
export function staffUpdateInfo(data) {
    return request({
        url: `/section/operation/modify/info`,
        method: 'post',
        data: data
    })
}

// 查询部门员工
export function lookDeepStaff(pageParams,data) {
    return request({
        url: `/section_employee/query_employee/?size=${pageParams.pageSize}&page=${pageParams.pageNum}`,
        method: 'post',
        data: data
    })
}

// 查看申请加入部门的员工
export function showApplyJoinDep(data) {
    return request({
        url: `/section/operation/look_not_approve`,
        method: 'get',
        data: data
    })
}

// 查看历史审批加入部门的记录
export function showApplyRecord(data) {
    return request({
        url: `/section/operation/look_approve/`,
        method: 'get',
        data: data
    })
}

// 审批员工加入部门
export function approveJoin(data) {
    return request({
        url: `/section/operation/approve_join/`,
        method: 'post',
        data: data
    })
}

// 查看公司中没有部门的员工
export function noSection(pageParams) {
    return request({
        url: `/section/operation/no_section/?size=${pageParams.pageSize}&page=${pageParams.pageNum}`,
        method: 'get',
    })
}

// 直接拉人进部门
export function pull(id) {
    return request({
        url: `/section/operation/${id}/direct_join/`,
        method: 'get',
    })
}

// 将员工从部门剔除
export function sectionRemoveStaff(data) {
    return request({
        url: `/section/operation/remove/`,
        method: 'post',
        data: data
    })
}

// 更换员工部门
export function changeSection(data) {
    return request({
        url: `/section/operation/change_section/`,
        method: 'post',
        data: data
    })
}

// 设置部门管理员
export function setSuper(data) {
    return request({ 
        url: `/section/operation/set_super/`,
        method: 'post',
        data: data
    })
}

// 撤销部门管理员
export function backoutSuper(data) {
    return request({
        url: `/section/operation/backout_super/`,
        method: 'post',
        data: data
    })
}

// 查看部门员工信息详情
export function showSectionStaff(id) {
    return request({
        url: `/section_employee/${id}`,
        method: 'get',
    })
}

// 查看部门下的员工分页版
export function deepEmployee(id,data) {
    return request({
        url: `/section/${id}/employee/`,
        method: 'get',
        data:{
            page:data.pageNum,
            size:data.pageSize
        }
    })
}